package String;

public class FindDifferent {
    public static boolean _Different(String iniString){
        if(iniString.isEmpty()){
            return true;
        }
        int[] flag=new int[128]; //辅助空间
        //扫描字符串
        for(int i=0;i<iniString.length();i++){
            int c=(int)iniString.charAt(i);
            if(flag[c]>0){
                return false;
            }else {
                flag[c]++;
            }
        }
        return true;
    }
    public static void main(String[] args) {
        System.out.println(_Different("abcdeafg"));
        System.out.println(_Different("BarackObama"));
    }
}
